package com.jesonking.openfeigncustomer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * created by jasonwang
 * on 2023/1/9 13:01
 */
@RestController
public class ConsumerController {
    @Resource
    private SpringCloudOpenFeignProviderClient openFeignProviderClient; // 加载 openfeign client

    @GetMapping("/consumer")
    public String consumer(@RequestParam String name) {
        // 向调用本地方法一样，调用 openfeign client 中的方法
        return openFeignProviderClient.call(name);
    }
}
